<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="keywords" content="html,css,html5,javascript">
    <meta name="author" content="yejf">
    <!-- 导入bootstrap 全局样式 -->
    <link rel="stylesheet" href="../../static/css/bootstrap.min.css" type="text/css">
    <title>jq plugin demo</title>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-6">
            <ul class="list-unstyled list-group">
                <li class="list-group-item"><a href="http://www.baidu.com" class="btn btn-primary">链接1</a></li>
                <li class="list-group-item"><a href="http://www.taobao.com">链接2</a></li>
                <li class="list-group-item"><a href="http://www.163.com">链接3</a></li>
                <li class="list-group-item"><a href="http://www.jd.com">链接4</a></li>
            </ul>
        </div>
    </div>
</div>


<script src="../../static/js/jquery.min.js" type="text/javascript"></script>
<script src="../../static/js/bootstrap.min.js" type="text/javascript"></script>
<!-- 导入自定义的插件 -->
<script src="plugin/jquery.helloPlugin.js"></script>
<script src="plugin/jquery.plugin.demo2.js"></script>
<script src="plugin/jquery.plugin.demo3.js"></script>

<script>
    //最简单方式来扩展 jquery
    $.extend({
        sayHello: function (name) {
            console.log("Hello," + (name ? name : "Dude") + "!");
        },
        log: function (message) {
            var now = new Date();
            console.log(now.toLocaleDateString()+" "+now.toLocaleTimeString()+" myApp: "+ message);
        }
    });

    $.sayHello();
    $.sayHello("jack");

    $.log("应用正在初始化");

    //
    $(function () {
        //直接调用方法名
        var len = $("a").helloPlugin({"color": "blue", "other": "abc"}).length;
        alert(len);

        //
        /*$("a").demo2({
            "color": "#dd34ff",
            "fontSize": "18px",
            "textDecoration": "underline"
        });*/

        $("a").demo3({'color': 'yellow'});
    })
</script>
</body>
</html>